'use strict';
angular.module('myApp.services')
    .factory('Gift',function(ENV,$resource, $rootScope,$log,$http, $q){
        return {
            //登录
            getGiftList: function () {
                var d = $q.defer();
                var promise = d.promise;
                var serveurl = ENV.api+'/gift_list.json';
                $http({
                    method:'GET',
                    url:serveurl,
                    params:{

                    }
                }).then(function(response){
                    console.log('getUserInfo response',response);

                    if(response.data){
                        d.resolve(response.data);
                    }else{
                        d.reject('获取礼品列表失败');
                    }


                },function(err){
                    d.reject('网络错误');
                });
                return promise;
            },

        }
    });